//
//  LZHorizontalBaseSubTableView.m
//  laziz_Merchant
//
//  Created by xbn_iMac on 2016/12/18.
//  Copyright © 2016年 XBN. All rights reserved.
//

#import "LZHorizontalBaseSubTableView.h"
#import "LZCustomPlayerView.h"
#import "UITableView+LZTableView.h"
#import "LZPlayVideoManager.h"

@implementation LZHorizontalBaseSubTableView

/**
 校验是否有数据
 */
- (void)checkHaveData {}

#pragma mark - configure Refresh UI

/**
 添加下拉刷新
 */
- (void)addHeaderRefresh {
    self.mj_header = [MJRefreshNormalHeader headerWithRefreshingTarget:self refreshingAction:@selector(downLoadNewData)];
    [self configHeaderRefreshText];
}

- (void)downLoadNewData {
    self.currentPlayCellIndexPath = nil;
}

/**
 添加上拉刷新
 */
- (void)addFooterRefresh {
    self.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(upLoadMoreData)];
    [self configFooterRefreshText];
}

- (void)upLoadMoreData {}


#pragma mark -
#pragma mark video play
/**
 离开页面,释放播放器内存
 */
- (void)releasePlayViewRAM
{
//    [self.playerView stopAction];
//    [self.playerView removeFromSuperview];
//    self.playerView = nil;
    [[LZPlayVideoManager shareManager] stopPlayWithPlayerView:self.playerView];
    self.currentPlayCellIndexPath = nil;
    
}

- (LZCustomPlayerView *)playerView
{
    if (!_playerView) {
        _playerView = [[LZCustomPlayerView alloc] init];
        _playerView.playCircle = YES;
    }
    
    return _playerView;
}

- (void)dealloc
{
    [self releasePlayViewRAM];
}

@end
